//
//  HMStatu.m
//  OC新浪微博
//
//  Created by wyman on 16/4/14.
//  Copyright © 2016年 wyman. All rights reserved.
//

#import "HMStatu.h"

@implementation HMStatu
+(instancetype)statuWithDict:(NSDictionary *)dict
{
    id obj = [[self alloc]init];
    
    [obj setValuesForKeysWithDictionary:dict];
    
    
    return obj;


}

-(void)setValue:(id)value forKey:(NSString *)key{

    if ([key  isEqual: @"user"]) {
        
        if ([value isKindOfClass:[NSDictionary class]]) {
            self.user = [[HMUser alloc]initWithDict:value];
        }
        
        return;    }
    
    if ([key  isEqual: @"retweeted_status"]) {
        
        if ([value isKindOfClass:[NSDictionary class]]) {
            self.retweeted_status = [HMStatu statuWithDict:value];
        }
        
        return;    }
    
    [super setValue:value forKey:key];
}

-(void)setPic_urls:(NSDictionary *)pic_urls
{
    _pic_urls = pic_urls;
    
    NSInteger count = pic_urls.count;
    
    if (count == 0) {
        return;
    }
    self.storePictureURLs = [NSMutableArray array];
    
 
    for (NSDictionary *url in pic_urls) {
        NSString *urlString = url[@"thumbnail_pic"];
        
        NSURL *url = [NSURL URLWithString:urlString];
        
        [self.storePictureURLs addObject:url];
        
    }

}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}
@end
